package com.financial.management;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;


import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;


public class AboutActivity  extends AppCompatActivity implements  View.OnClickListener{
    Button image1,image2,image3;
    FbottomFragement fbottomFragement =new FbottomFragement();
    FbottomFragement2 fbottomFragement2 =new FbottomFragement2();
    FbottomFragement3 fbottomFragement3 =new FbottomFragement3();


    @Override
    protected void onCreate( Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_about);
        image1 =findViewById(R.id.image1);
        image2 =findViewById(R.id.image2);
        image3 =findViewById(R.id.image3);
        image1.setOnClickListener(this);
        image2.setOnClickListener(this);
        image3.setOnClickListener(this);
        Log.d("PageTransition", "Arrived at Page B");



    }

    @Override
    public void onClick(View v) {
        switch(v.getId()){
            case R.id.image1:
                FragmentManager fragmentManager = getSupportFragmentManager();
                FragmentTransaction transaction =fragmentManager.beginTransaction();
                transaction.replace(R.id.bottom_layout,fbottomFragement);

                transaction.commit();
                break;
            case R.id.image2:
                fragmentManager = getSupportFragmentManager();
                transaction = fragmentManager.beginTransaction();
                transaction.replace(R.id.bottom_layout,fbottomFragement2);

                transaction.commit();
                break;

            case R.id.image3:
                 fragmentManager = getSupportFragmentManager();
                transaction = fragmentManager.beginTransaction();
                transaction.replace(R.id.bottom_layout,fbottomFragement3);

                transaction.commit();
                break;



        }

    }
}
